//
// Created by baigui on 2021/10/19.
//

#ifndef SIMPLE_PLAYER_MP4BOX_H
#define SIMPLE_PLAYER_MP4BOX_H


#include "libmp4.h"

class Mp4Box {

public:

    uint64_t     i_pos;      /* absolute position */

    uint32_t     i_type;
    uint32_t     i_shortsize;
    uint32_t     i_handler;  /**/
    uint32_t     i_index;    /* indexed list (ilst) */

    enum
    {
        BOX_FLAG_NONE = 0,
        BOX_FLAG_INCOMPLETE,
    }            e_flags;

    UUID_t       i_uuid;  /* Set if i_type == "uuid" */

    uint64_t     i_size; /* always set so use it */

    Mp4Box *p_father; /* pointer on the father Box */
    Mp4Box *p_first;  /* pointer on the first child Box */
    Mp4Box *p_last;
    Mp4Box *p_next;   /* pointer on the next boxes at the same level */

    void (*pf_free)( Mp4Box *p_box ); /* pointer to free function for this box */

    void free();

//    MP4_Box_data_t   data;   /* union of pointers on extended data depending on i_type (or i_usertype) */

};


#endif //SIMPLE_PLAYER_MP4BOX_H
